package priv.yiyuan.example.design.wrapper;

/**
 * 日志记录装饰器
 * <p>
 * 装饰器模式-具体装饰器
 *
 * @author YiYuan
 * @data 2025/9/2
 * @apoNote
 */
public class LoggingDecorator extends PaymentDecorator {

    public LoggingDecorator(PaymentStrategy decoratedPayment) {
        super(decoratedPayment);
    }

    @Override
    public void pay(double amount) {
        System.out.println("记录支付日志: 支付金额 " + amount + ", 支付方式: " + decoratedPayment.getDescription() + "。");
        super.pay(amount);
        System.out.println("支付日志记录完成。");
    }

    @Override
    public String getDescription() {
        return super.getDescription() + " + 日志记录";
    }
}
